<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <script language="javascript">
         function check1(){
           if(document.form2.uname.value==""){
           alert("用户名不能为空");
           return false;
           }
           if(document.form2.upass.value==""){
           alert("密码不能为空");
           return false;
           }
           if(document.form2.uname.value!=document.form1.uname.value){
           alert("用户名不存在，请重新输入");
           return false;
           }
           if(document.form2.upass.value！=document.form1.upass.value){
           alert("密码错误，请重新输入");
           return false;
           }
}
</script>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="CSS/ll.css">
	

  </head>
  
  <body>
    <div id="apDiv1">
  <div align="center"class="STYLE1">校园BBS系统</div>
  </div>
  <div class="STYLE4" id="apDiv2">
  您尚未<a href="login.jsp" target="_self">登录</a>|
  <a href="reg.jsp" target="_self">注册</a>|</div>

  <div class="STYLE4" id="apDiv4">
   >><a href="index.jsp" target="_self">论坛首页</a>
    <form id="form2" name="form2" method="post" action="index.jsp" onsubmit="return check1()">
         <table width="100%" height="115px" border="0" cellspacing="0" cellpadding="0"> 
           <tr>
              <td align="center"><span class="body">用户名：</span>
               <label>
               <input name="uname" type="text" id="textfield4"/>
               </label></td>
           </tr>
           <tr>
              <td align="center"><span class="body">密码：</span>
               <label>
               <input name="upass" type="password" id="textfield5"/>
               </label></td>          
           </tr>
           <tr>
               <td align="center">
                 <label>
                 <input type="submit" name="button2" id="button2" value="登陆"/> 
                 </label></td>
           </tr>
           </table>
         </form>
      </div>   
    <br>
  </body>
</html>
